Skip to content

Conversation

@dwradcliffe
Copy link
Contributor

@dwradcliffe dwradcliffe commented Sep 2, 2024

Part of #57

This adds the ability for an admin user to set permissions for each user. This does not allow these permissions to be used, that will be in the next PR.

@AnalogJ
Copy link
Member

AnalogJ commented Oct 3, 2024

Hey @dwradcliffe , just wanted to check in. Did you want me to review your PR, or is it still under development?

@dwradcliffe dwradcliffe marked this pull request as ready for review October 6, 2024 02:23
if result.Error != nil {
return result.Error
}
// Update User Permissions
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ideally this would all be handed by the GORM Association logic & hooks

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated, please take a look

Picture string `json:"picture"`
Email string `json:"email"`
Role pkg.UserRole `json:"role"`
Permissions map[string]map[string]bool `json:"permissions" gorm:"-:all"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we use GORM references for this - https://gorm.io/docs/has_many.html#Override-References

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not 100% sure what you're suggesting here. I'm using a different format for the api so that it's easier to handle the frontend concerns without leaking the database structure into the frontend. I think the current version is a good compromise but please take a look.

@dwradcliffe dwradcliffe force-pushed the user_acls branch 2 times, most recently from 66b1310 to a9bf9b2 Compare February 15, 2025 19:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants